<template>
	<div id="stockeXamine">
    <el-dialog v-loading="loading"  title="物品信息" :visible.sync="active" width="30%" top="3vh" :close-on-click-modal='false'>
      <div style="width:90%;margin: 0 40px 0 40px; padding-bottom:20px;">


          <div style="margin-top:10px;" class="tabbox">
            <p style=""><a style="color:red;">* </a>物料编码：{{datas.sku}}</p>
          </div>
          <div style="margin-top:10px;" class="tabbox">
            <p style=""><a style="color:red;">* </a>物品名称：{{datas.name}}</p>
          </div>
<!--          <div style="margin-top:10px;" class="tabbox">-->
<!--            <p style=""><a style="color:red;">* </a>申请数量：{{datas.amount}}</p>-->
<!--          </div>-->
          <div style="margin-top:10px;" class="tabbox">
            <p style=""><a style="color:red;">* </a>物品单价：{{datas.price}}</p>
          </div>
          <div style="margin-top:10px;" class="tabbox">
            <p style=""><a style="color:red;">* </a>物品类型：{{id_name(datas.typeId,$store.state.user.leidata)}}</p>
          </div>
          <div style="margin-top:10px;" class="tabbox">
            <p style=""><a style="color:red;">* </a>物品尺寸：{{datas.size}}</p>
          </div>
          <div style="margin-top:10px;" class="tabbox">
            <p style=""><a style="color:red;">* </a>物品型号：{{datas.model}}</p>
          </div>
          <div style="margin-top:10px;" class="tabbox">
            <p style=""><a style="color:red;">* </a>供应商：{{datas.provider}}</p>
          </div>
		  <div style="margin-top:10px;" class="tabbox">
		    <p style=""><a style="color:red;">* </a>备注：{{datas.remarks}}</p>
		  </div>
		  <div style="margin-top:10px;" class="tabbox">
		    <p style=""><a style="color:red;">* </a>申请原因：{{datas.purpose}}</p>
		  </div>
      </div>
      <div style="width:100%;height:40px;margin-top:20px;">
        <div style="width:170px;margin: 0 auto;">
          <el-button type="danger" @click="rebut">取 消</el-button>
          <el-button type="primary" @click="end" style='float:right;'>确 认</el-button>
        </div>
      </div>
    </el-dialog>
    <!-- <el-dialog v-loading="loading"  title="驳回理由" :visible.sync="actives" width="25%" :close-on-click-modal='false'>
        <el-input type="textarea" :autosize="{ minRows: 4, maxRows: 4}" placeholder="请输入内容" v-model="reason"></el-input>
        <div style="width:100%;height:40px;margin-top:20px;">
          <div style="width:170px;margin: 0 auto;">
            <el-button type="danger" @click= "cancel">取 消</el-button>
            <el-button type="primary" @click = "agree">发 送</el-button>
          </div>
        </div>
    </el-dialog> -->
  </div>
</template>

<script>
  import {joinStock} from '@/api_bast/stock.js'
	export default {
		name: '',
		data(){
			return{
				loading: false,
        actives: false,
        reason: '',
        active:false,
			}
		},
		components:{

		},
    props:{
      datas:Object
    },
    methods:{
      qf(){
        return this.active = !this.active
      },
      rebut(){//取消
        this.$parent.hidn()
        // this.actives = true //驳回理由框打开
      },
      end(){//完结
	    this.$parent.hidn()
	    this.$confirm('是否确认入库?', '提示', {
	    	  confirmButtonText: '确定',
	    	  cancelButtonText: '取消',
	    	  type: 'warning'
	    	}).then(() => {
				this.loading=true
				joinStock(this.datas.id).then(res=>{
            if(res.code == 200){
						  this.loading=false
						  this.$notify({title: '完成',message: '入库成功',type: 'success'})
						  this.$parent.get_data()
						}
					}).catch(() => {})
          }).catch(()=>{this.$notify({title: '取消',type:'info',message:'已取消入库'})})
		}
	}
}
</script>

<style scoped="scoped">
.tabbox{
    width:100%;
    height:30px;
    line-height: 30px;
    margin-top:23px;

  }

</style>
